ScrollIndicator

Kind of class:class
Inherits from:UIComponent < MovieClip
Known subclasses:
Classpath:gfx.controls.ScrollIndicator
File last modified:Tuesday, 29 June 2010, 09:03:27
The CLIK ScrollIndicator displays the scroll position of another component, such as a multiline textField. It can be pointed at a textField to automatically display its scroll position. All list-based components as well as the TextArea have a scrollBar property which can be pointed to a ScrollIndicator or ScrollBar instance or linkage ID.

Inspectable Properties
The inspectable properties of the ScrollIndicator are:
  • scrollTarget: Set a TextArea or normal multiline textField as the scroll target to automatically respond to scroll events. Non-text field types have to manually update the ScrollIndicator properties.
  • visible: Hides the component if set to false.
  • disabled: Disables the component if set to true.
  • offsetTop: Thumb offset at the top. A positive value moves the thumb's top-most position higher.
  • offsetBottom: Thumb offset at the bottom. A positive value moves the thumb's bottom-most position lower.
  • enableInitCallback: If set to true, _global.CLIK_loadCallback() will be fired when a component is loaded and _global.CLIK_unloadCallback will be called when the component is unloaded. These methods receive the instance name, target path, and a reference the component as parameters. _global.CLIK_loadCallback and _global.CLIK_unloadCallback should be overriden from the game engine using GFx FunctionObjects.
  • soundMap: Mapping between events and sound process. When an event is fired, the associated sound process will be fired via _global.gfxProcessSound, which should be overriden from the game engine using GFx FunctionObjects.
States
The ScrollIndicator does not have explicit states. It uses the states of its child elements, the thumb and track Button components.

Events
All event callbacks receive a single Object parameter that contains relevant information about the event. The following properties are common to all events.
  • type: The event type.
  • target: The target that generated the event.
The events generated by the ScrollIndicator component are listed below. The properties listed next to the event are provided in addition to the common properties.
  • show: The component’s visible property has been set to true at runtime.
  • hide: The component’s visible property has been set to false at runtime.
  • scroll: The scroll position has changed.
    • position: The new scroll position. Number type. Values minimum position to maximum position.
Component metadata:
    InspectableList
    "disabled"
    "enableInitCallback"
    "inspectableScrollTarget"
    "offsetBottom"
    "offsetTop"
    "soundMap"
    "visible"

    Summary


    Constructor
    Instance properties
    • direction
      • Whether the component is horizontal or vertical.
    • soundMap
      • Mapping between events and sound process
    • thumb
      • A reference to the thumb symbol in the ScrollIndicator.
    • track
      • A reference to the track symbol in the ScrollIndicator.
    • disabled
      • Disable this component.
    • position
      • Set the scroll position to a number between the minimum and maximum.
    • scrollTarget
      • Set a text target for the ScrollIndicator to respond to scroll changes.
    • availableHeight
      • Returns the available scrolling height of the component.
    Class methods
    Class methods inherited from UIComponent
    Instance methods

    Constructor

    ScrollIndicator

    function ScrollIndicator (
    )

    The constructor is called when a ScrollIndicator or a sub-class of ScrollIndicator is instantiated on stage or by using attachMovie() in ActionScript. This component can not be instantiated using new syntax. When creating new components that extend ScrollIndicator, ensure that a super() call is made first in the constructor.

    Instance properties

    availableHeight

    availableHeight:Number
    (read)

    Returns the available scrolling height of the component.

    direction

    direction:String = "vertical"
    (read,write)

    Whether the component is horizontal or vertical. This property is auto-set on stage components based on their rotation.

    disabled

    disabled:Boolean
    (read,write)

    Disable this component.

    position

    position:Number
    (read,write)

    Set the scroll position to a number between the minimum and maximum.

    scrollTarget

    scrollTarget:Object
    (read,write)

    Set a text target for the ScrollIndicator to respond to scroll changes.
    Non-text fields have to manually update the properties.

    soundMap

    soundMap:Object = { theme:"default", scroll:"scroll" }
    (read,write)

    Mapping between events and sound process

    thumb

    thumb:Button
    (read,write)

    A reference to the thumb symbol in the ScrollIndicator.

    track

    track:MovieClip
    (read,write)

    A reference to the track symbol in the ScrollIndicator.

    Instance methods

    setScrollProperties

    function setScrollProperties (
    pageSize:Number, minPosition:Number, maxPosition:Number, pageScrollSize:Number) : Void

    Set the scroll properties of the component.
    Parameters:
    pageSize :
    The size of the pages to determine scroll distance.
    minPosition :
    The minimum scroll position.
    maxPosition :
    The maximum scroll position.
    pageScrollSize:
    The amount to scroll when "paging". Not currently implemented.

    update

    function update (
    ) : Void

    Manually update the scrollBar when the target changes.